var obj = {
    a: 'hello',
    b: {
        c: 'world',
        d: 111
    },
    e: [11, 'Jack', 'Tom']
}

function shallowCopy(obj) {
    return Object.create(obj);
}

function myShallowCopy(obj) {
    var newObj = {};
    for (var key in obj) {
        newObj[key] = obj[key];
    }
    return newObj;
}

function deepCopy(obj) {
    return JSON.parse(JSON.stringify(obj));
}

function myDeepCopy(obj) {
    if (typeof obj !== 'object') {
        return obj;
    }
    if (obj instanceof Array) {
        var array = [];
        for (var i = 0; i < obj.length; i++) {
            array[i] = myDeepCopy(obj[i]);
        }
        return array;
    }
    var newObj = {};
    for (var key in obj) {
        newObj[key] = myDeepCopy(obj[key]);
    }
    return newObj;
}
